package com.jhs.kjs.service.impl;

import java.util.List;
import java.util.Map;

import com.jhs.kjs.dto.BoardDTO;
import com.jhs.kjs.dto.BoardPagingDTO;
import com.jhs.kjs.service.IBoardService;
import com.jhs.kjs.service.dao.IBoardMapper;

public class BoardServiceImpl implements IBoardService{

	private IBoardMapper mapper;

	public void setMapper(IBoardMapper mapper) {
		this.mapper = mapper;
	}

	@Override
	public List<BoardPagingDTO> getBoardList(BoardPagingDTO param) {
		return mapper.getBoardList(param);
	}
	
	@Override
	public BoardPagingDTO getBoardCount(BoardPagingDTO param) {
		return mapper.getBoardCount(param);
	}
	
	@Override
	public List<BoardPagingDTO> getQnaBoardList(BoardPagingDTO param) {
		return mapper.getQnaBoardList(param);
	}
	
	@Override
	public BoardPagingDTO getQnaBoardCount(BoardPagingDTO param) {
		return mapper.getQnaBoardCount(param);
	}
	
	@Override
	public BoardPagingDTO getQnaPrevBoardView(BoardPagingDTO param) {
		return mapper.getQnaPrevBoardView(param);
	}
	
	@Override
	public BoardPagingDTO getQnaNextBoardView(BoardPagingDTO param) {
		return mapper.getQnaNextBoardView(param);
	}
	
	@Override
	public BoardPagingDTO getBoardView(Map<String, Long> param) {
		return mapper.getBoardView(param);
	}
	
	@Override
	public BoardPagingDTO getPrevBoardView(Map<String, Long> param) {
		return mapper.getPrevBoardView(param);
	}
	
	@Override
	public BoardPagingDTO getNextBoardView(Map<String, Long> param) {
		return mapper.getNextBoardView(param);
	}
	
	@Override
	public int updateViewCnt(Map<String, Long> param) {
		return mapper.updateViewCnt(param);
	}
	
	@Override
	public int updateDownloadCnt(Map<String, Long> param) {
		return mapper.updateDownloadCnt(param);
	}
	
	@Override
	public int registBoard(BoardPagingDTO param) {
		return mapper.registBoard(param);
	}
	
	@Override
	public int updateBoard(BoardPagingDTO param) {
		return mapper.updateBoard(param);
	}
	
	@Override
	public List<BoardPagingDTO> getHelpQnaBoardList(BoardPagingDTO param) {
		return mapper.getHelpQnaBoardList(param);
	}
	
	@Override
	public BoardPagingDTO getHelpQnaBoardCount(BoardPagingDTO param) {
		return mapper.getHelpQnaBoardCount(param);
	}
	
	@Override
	public BoardPagingDTO getHelpQnaPrevBoardView(Map<String, Long> param) {
		return mapper.getHelpQnaPrevBoardView(param);
	}
	
	@Override
	public BoardPagingDTO getHelpQnaNextBoardView(Map<String, Long> param) {
		return mapper.getHelpQnaNextBoardView(param);
	}
	
	@Override
	public int deleteBoard(Map<String, Long> param) {
		int result = 0;
		result = mapper.deleteBoard(param);
		result &= mapper.deleteReplyBoard(param);
		return result;
	}
}
